from django.db import models


class HostToRemoteUser(models.Model):
    """
    主机与远程用户多对多映射关系，用于和堡垒机的账号表多对多关联，也会和主机组多对多关联
    """
    host = models.CharField("Host")

    remote_user = models.CharField("RemoteUser")

    class Meta:
        unique_together = ("host", "remote_user")

    def __str__(self):
        return f'{self.host} -> {self.remote_user}'
